package com.pesking.core.sqlparser.processor;

import java.util.Arrays;
import java.util.List;

import com.pesking.core.parameter.Parameter;
import com.pesking.core.sqlparser.parameter.SqlParameter;
import com.pesking.core.sqlparser.parameter.SqlParameterProcessor;
import com.pesking.core.util.StringUtils;


public class UUIDSqlParameterHandler extends SqlParameterProcessor {

	@Override
	public String getTitle() {
		return "生成30位UUID参数";
	}

	@Override
	public String getDescription() {
		return "填充30位UUID值";
	}

	@Override
	public String getUsage() {
		return "[UUID]";
	}

	@Override
	public List<String> getSqlParameterType() {
		return Arrays.asList(new String []{"UUID"});
	}

	@Override
	public void handle(StringBuilder sbSQL, Parameter parameter, List<SqlParameter> processors,SqlParameter sqlParameter) {
		String uuid = StringUtils.generateUUID();
		sbSQL.append("'" + uuid + "'");
	}
}
